<?php

class OptionsController extends Controller {

    public function actionIndex() {
        $model = new OptionsForm;
        if (isset($_POST['OptionsForm'])) {
            $content = "<?php\r\n\r\n return " . var_export($_POST['OptionsForm'], true) . "\r\n\r\n?>";
            @file_put_contents(Yii::app()->basePath . '/config/params.php', $content);
            $this->redirect('options');
        }
        $this->render('index', array('model' => $model));
    }

}